﻿using System;
using UnityEngine;

namespace ParticlePlayground
{
	// Token: 0x02000150 RID: 336
	public class TrailPoint
	{
		// Token: 0x06000755 RID: 1877 RVA: 0x0002B56C File Offset: 0x0002976C
		public TrailPoint(Vector3 position, float startLifetime, float creationTime)
		{
			this.position = position;
			this.lifetime = startLifetime;
			this.startLifetime = startLifetime;
			this.width = 0f;
			this._lastTimeUpdated = creationTime;
		}

		// Token: 0x06000756 RID: 1878 RVA: 0x0002B59C File Offset: 0x0002979C
		public TrailPoint(Vector3 position, float startLifetime, float width, float creationTime)
		{
			this.position = position;
			this.lifetime = startLifetime;
			this.startLifetime = startLifetime;
			this.width = width;
			this._lastTimeUpdated = creationTime;
		}

		// Token: 0x06000757 RID: 1879 RVA: 0x0002B5C8 File Offset: 0x000297C8
		public TrailPoint(Vector3 position, Vector3 velocity, float startLifetime, float width, float creationTime)
		{
			this.position = position;
			this.lifetime = startLifetime;
			this.startLifetime = startLifetime;
			this.width = width;
			this.velocity = velocity;
			this._lastTimeUpdated = creationTime;
		}

		// Token: 0x06000758 RID: 1880 RVA: 0x0002B5FC File Offset: 0x000297FC
		public virtual void Update(float updateTime, float width)
		{
			this.lifetime -= updateTime - this._lastTimeUpdated;
			if (this.lifetime <= 0f)
			{
				this._canRemove = true;
				this.lifetime = 0f;
			}
			this.width = width;
			this._lastTimeUpdated = updateTime;
		}

		// Token: 0x06000759 RID: 1881 RVA: 0x0002B650 File Offset: 0x00029850
		public virtual float GetNormalizedLifetime()
		{
			return 1f - this.lifetime / this.startLifetime;
		}

		// Token: 0x0600075A RID: 1882 RVA: 0x0002B668 File Offset: 0x00029868
		public virtual bool CanRemove()
		{
			return this._canRemove;
		}

		// Token: 0x04000765 RID: 1893
		public Vector3 position;

		// Token: 0x04000766 RID: 1894
		public Vector3 velocity;

		// Token: 0x04000767 RID: 1895
		public float lifetime;

		// Token: 0x04000768 RID: 1896
		public float startLifetime;

		// Token: 0x04000769 RID: 1897
		public float width;

		// Token: 0x0400076A RID: 1898
		protected bool _canRemove;

		// Token: 0x0400076B RID: 1899
		protected float _lastTimeUpdated;
	}
}
